knitr::opts_chunk$set(echo = TRUE)
library('AZASRS')
library('tidyverse')

NAV daily

get_pm_nav_daily(return_tibble = TRUE) %>% head(5)
# However, in this case, the default is TRUE so it is not needed

Cash flow daily

get_pm_cash_flow_daily(return_tibble = FALSE) %>% head(5)

Fund Info

get_pm_fund_info() %>% head(5)

Benchmarks

con = AZASRS_DATABASE_CONNECTION()
get_benchmark_daily_index(con, return_tibble = FALSE) %>% 
  filter(effective_date >= '2018-01-01') %>%
  as_tibble() %>%
  head(10)

Calculate grouped IRR's

All settings are adjustable

nav = get_pm_nav_daily() %>% dplyr::filter(nav != 0)
cf = get_pm_cash_flow_daily() %>% dplyr::filter(cash_flow != 0)
pm_fund_info = get_pm_fund_info()
start_date = '2019-09-30'
end_date = '2019-12-31'
itd = FALSE
cash_adjusted = FALSE

Pulling portfolio level data

final_data = build_grouped_irrs(start_date = start_date, end_date = end_date, itd = itd,
                                cash_adjusted = cash_adjusted, pm_fund_info = pm_fund_info,                                 pm_fund_portfolio)
final_data %>%
  head()

Pulling portfolio + category data

final_data = build_grouped_irrs(start_date = start_date, end_date = end_date, itd = itd,
                                cash_adjusted = cash_adjusted, pm_fund_info = pm_fund_info,                                 pm_fund_portfolio, pm_fund_category_description)

final_data %>%
  head()

Pulling portfolio + category + fund data

final_data = build_grouped_irrs(start_date = start_date, end_date = end_date, itd = itd,
                                cash_adjusted = cash_adjusted, pm_fund_info = pm_fund_info,                                 pm_fund_portfolio, pm_fund_category_description, pm_fund_common_name)

final_data %>%
  head()

Aggregation options can be seen from the pm_fund_info table:

pmfi = get_pm_fund_info()

colnames(pmfi)


AZASRS/AZASRS documentation built on Sept. 30, 2020, 9:26 p.m.